<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>

<div id="vk_api_transport"></div>
<script type="text/javascript">
    window.vkAsyncInit = function() {
        VK.init({
            apiId: 2209263
        });
    };

    setTimeout(function() {
        var el = document.createElement("script");
        el.type = "text/javascript";
        el.src = "http://vkontakte.ru/js/api/openapi.js";
        el.async = true;
        document.getElementById("vk_api_transport").appendChild(el);
    }, 0);
</script>


<script src="http://vkontakte.ru/js/api/openapi.js" type="text/javascript"></script>

<div id="login_button" onclick="VK.Auth.login(authInfo);"></div>

<script language="javascript">
    VK.init({
        apiId: 2209263
    });
    function authInfo(response) {
        if (response.session) {
            //alert('user: '+response.session.mid);
            console.log('ID USER ' + response.session.mid);

        } else {
            alert('not auth');
        }
    }

    function getit(response) {
        if (response.session) {
            var id = response.session.mid;
        }
        VK.Api.call('video.get', {uids: id, fields: 'sex,photo_big'}, function(r) {
            if(r.response) {
                //alert(r.response[0].sex);


                for(var i = 0; i < r.response.length; i++) {
                    console.log(r.response[i].title); //r.response
                }
            }
        });
    }

    VK.Auth.getLoginStatus(authInfo);

    VK.Auth.getLoginStatus(getit);

    VK.UI.button('login_button');
</script>

</body>
</html>